package com.prd.controller;


import com.prd.dto.SysPositionDescribeDTO;
import com.prd.model.SysPositionDescribeDO;
import com.prd.service.SysPositionDescribeService;
import com.prd.util.CommonUtil;
import com.prd.util.JsonData;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 职务说明书 前端控制器
 * </p>
 *
 * @author lizhaoyi
 * @since 2024-01-28
 */
@RestController
@RequestMapping("/api/sysPositionDescribe")
@Api(tags = "职务说明书")
public class SysPositionDescribeController {

    @Autowired
    private SysPositionDescribeService describeService;

    @PostMapping("add")
    @ApiOperation("新建职务说明书")
    public JsonData add(@RequestBody SysPositionDescribeDTO describeDTO){

        return describeService.add(describeDTO);
    }

    @GetMapping("/{id}")
    @ApiOperation("查看职务说明书详情")
    public JsonData detail(@PathVariable("id") Long id){

        return describeService.detail(id);
    }

    @PutMapping
    @ApiOperation("修改职务说明书")
    public JsonData edit(@RequestBody SysPositionDescribeDTO describeDTO){

        return describeService.edit(describeDTO);
    }
}

